import * as v from 'valibot';

export const File = v.object({
    uuid: v.pipe(v.string(), v.uuid()),
    link: v.string(),
    owner: v.string(),
    filename: v.string(),
    content_type: v.string(),
    file_size: v.number(),
    uploaded_at: v.pipe(v.string(), v.isoTimestamp()),
    // relation_name is either an empty string or path like string
    // (e.g. "/category/2022/filename.txt"). Empty string equals to "/".
    relation_name: v.string(),  
    is_public: v.boolean(),
})

export type File = v.InferOutput<typeof File>;
